Hello all, |
Re: How to Display Object Modifications of Suspect Links of Baselined Module
Suspect links work as you probably know by comparing the "Suspicion Cleared Forwards"/"Suspicion Cleared Backwards" date on the link (i.e. the date when the suspicions were last cleared) with the last modification date of the object. What is not so well known is, that you can get the exact time an object was last modified by calling the 'Date lastModifiedTime (Object)' perm. This perm can return null for data from earlier versions, so if this perm will return null you have to take the "last modified on" attribute, which will only give you the day.
Baseline b
Module m
Date modificationDate = "11/19/09 10:00:00"
Object searchObj = current
Skip sk = create()
Date D
int count = 0
// Use a skip list to sort the baselines in reverse order
for b in current Module do put (sk, count--, b);
// put a dummy item to the skip list, so we can use the same
// loop for current module and baselines. Put it after the last one
put (sk, count , null Baseline)
// iterate through the baselines
for b in sk do {
if (!null b) {
// check if the baseline was done before the modificationd date
// -> no interesting history could be in there
D = dateAndTime dateOf b
if (D < modificationDate) break
// load the baseline
print "Scanning baseline: " (major b) "." (minor b) (suffix b) " --> " D "\n"
m = load(b, false)
} else {
// load the current module
print "Scanning current module ...\n"
m = current Module
}
// find the object in the baseline by absolute number
int searchNr = searchObj."Absolute Number"
// first search the object using the fast object function
// won't work for non visible objects, use a 'for obj in entire m'
// loop to maybe find the object if it is null
Object targetObj = object(searchNr, m)
// if the object did not exist in the baseline then do nothing
if (null targetObj) { print "Object not found!"; halt }
History h
// scan the object history in the baseline
for h in targetObj do {
Date historyDate = h.date
if (historyDate > modificationDate) {
print "Scanning history entry: " h.date "\n"
if (h.type == modifyObject) {
print h.oldValue "->" h.newValue "\n"
}
}
}
}
|
Re: How to Display Object Modifications of Suspect Links of Baselined Module Mathias Mamsch - Tue Dec 08 20:11:11 EST 2009
Suspect links work as you probably know by comparing the "Suspicion Cleared Forwards"/"Suspicion Cleared Backwards" date on the link (i.e. the date when the suspicions were last cleared) with the last modification date of the object. What is not so well known is, that you can get the exact time an object was last modified by calling the 'Date lastModifiedTime (Object)' perm. This perm can return null for data from earlier versions, so if this perm will return null you have to take the "last modified on" attribute, which will only give you the day.
Baseline b
Module m
Date modificationDate = "11/19/09 10:00:00"
Object searchObj = current
Skip sk = create()
Date D
int count = 0
// Use a skip list to sort the baselines in reverse order
for b in current Module do put (sk, count--, b);
// put a dummy item to the skip list, so we can use the same
// loop for current module and baselines. Put it after the last one
put (sk, count , null Baseline)
// iterate through the baselines
for b in sk do {
if (!null b) {
// check if the baseline was done before the modificationd date
// -> no interesting history could be in there
D = dateAndTime dateOf b
if (D < modificationDate) break
// load the baseline
print "Scanning baseline: " (major b) "." (minor b) (suffix b) " --> " D "\n"
m = load(b, false)
} else {
// load the current module
print "Scanning current module ...\n"
m = current Module
}
// find the object in the baseline by absolute number
int searchNr = searchObj."Absolute Number"
// first search the object using the fast object function
// won't work for non visible objects, use a 'for obj in entire m'
// loop to maybe find the object if it is null
Object targetObj = object(searchNr, m)
// if the object did not exist in the baseline then do nothing
if (null targetObj) { print "Object not found!"; halt }
History h
// scan the object history in the baseline
for h in targetObj do {
Date historyDate = h.date
if (historyDate > modificationDate) {
print "Scanning history entry: " h.date "\n"
if (h.type == modifyObject) {
print h.oldValue "->" h.newValue "\n"
}
}
}
}
I've used the above code as a basis for finding objects within created baselines. One problem I'm finding however is that the module I am using is very old, and has many baselines. My system will long run out of resources before it can scan all the baselines and return the results I'm looking for. I suspect that is because I am opening multiple modules/baselines here, but I'm not certain. After opening 10 modules from baselines, per the code, I'm well over 1.5G of memory allocated to DOORS - even if I halt the script, deleting the skip list and closing the current module, I can't regain the system resources. Is there any way to free up the resources that are being taxed somehow? While I understand DXL to a degree, garbage collection within DOORS is definitely not my strong suit. Any help would be appreciated! Thanks, Mike |
Re: How to Display Object Modifications of Suspect Links of Baselined Module SystemAdmin - Wed Jun 09 16:06:00 EDT 2010 You should not have all baselines opened at the same time if you don't need to. There is no such thing like "Automatic Garbage Collection" in DXL you need to take care of the ressources you allocate yourself. Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: How to Display Object Modifications of Suspect Links of Baselined Module Mathias Mamsch - Tue Dec 08 20:11:11 EST 2009
Suspect links work as you probably know by comparing the "Suspicion Cleared Forwards"/"Suspicion Cleared Backwards" date on the link (i.e. the date when the suspicions were last cleared) with the last modification date of the object. What is not so well known is, that you can get the exact time an object was last modified by calling the 'Date lastModifiedTime (Object)' perm. This perm can return null for data from earlier versions, so if this perm will return null you have to take the "last modified on" attribute, which will only give you the day.
Baseline b
Module m
Date modificationDate = "11/19/09 10:00:00"
Object searchObj = current
Skip sk = create()
Date D
int count = 0
// Use a skip list to sort the baselines in reverse order
for b in current Module do put (sk, count--, b);
// put a dummy item to the skip list, so we can use the same
// loop for current module and baselines. Put it after the last one
put (sk, count , null Baseline)
// iterate through the baselines
for b in sk do {
if (!null b) {
// check if the baseline was done before the modificationd date
// -> no interesting history could be in there
D = dateAndTime dateOf b
if (D < modificationDate) break
// load the baseline
print "Scanning baseline: " (major b) "." (minor b) (suffix b) " --> " D "\n"
m = load(b, false)
} else {
// load the current module
print "Scanning current module ...\n"
m = current Module
}
// find the object in the baseline by absolute number
int searchNr = searchObj."Absolute Number"
// first search the object using the fast object function
// won't work for non visible objects, use a 'for obj in entire m'
// loop to maybe find the object if it is null
Object targetObj = object(searchNr, m)
// if the object did not exist in the baseline then do nothing
if (null targetObj) { print "Object not found!"; halt }
History h
// scan the object history in the baseline
for h in targetObj do {
Date historyDate = h.date
if (historyDate > modificationDate) {
print "Scanning history entry: " h.date "\n"
if (h.type == modifyObject) {
print h.oldValue "->" h.newValue "\n"
}
}
}
}
Suspect Links should be defined as Mattias states, but I believe it works in a slightly different way. In DOORS 8.1 changes to any link attribute which changes 'change date' (use bool lastModifiedTime(Link l) to find out) will clear the suspiciousness of the link, both as inlink and outlink. This suggests it is really a comparison of the change date of the object (in the other end) and the link which is used to determine if a link is suspect. The effect of this is that clearing a suspect link for a certain direction also will clear the other direction. In DOORS 9.2 this behavior is still the same for suspect outlinks but not for the inlinks. Suspect Inlinks are really using the 'Suspicion Cleared Backwards' attribute. /Anders |
Re: How to Display Object Modifications of Suspect Links of Baselined Module a_vestlin - Thu Jun 10 02:40:10 EDT 2010 The "Suspicion Last Cleared" Value of the link is therefore the value of those attributes if they have one, otherwise it is the last modified time of the link (which is usually the link creation date. Who uses link attributes anyway :-)). This "Suspicion Last Cleared" value is compared to the "last modified time" of the target object (out link) or source object (in link). I am pretty sure that this is how the suspicion is determined in DOORS 8.1 too, in DOORS 8.2 it is definitly like this. I would bet that it is the same in DOORS 9 too. Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: How to Display Object Modifications of Suspect Links of Baselined Module Mathias Mamsch - Thu Jun 10 03:14:34 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS /Anders |
Re: How to Display Object Modifications of Suspect Links of Baselined Module Mathias Mamsch - Wed Jun 09 17:26:17 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Mathias,
if (!null b) {
xCount += 1
if(xCount == 10) {
delete(sk)
halt
}
}
|
Re: How to Display Object Modifications of Suspect Links of Baselined Module SystemAdmin - Thu Jun 10 09:20:11 EDT 2010
Mathias,
if (!null b) {
xCount += 1
if(xCount == 10) {
delete(sk)
halt
}
}
I guess a 16000 object module (depending on the contents) can take its 120MB in memory. If you open 10 baselines of it, you will have 1,2GB - no problem to believe that. How much memory does DOORS consume before and after you open that module manually from the database explorer? If we are talking about a module that large you need better code than what I posted. What exactly are you trying to accomplish? Is it feasible to just close each baseline after scanning it? Or do you need to access the information from the baselines later? If we don't have a memory leak here, then I guess the key would be to read the neccessary information from all the baselines and store them somewhere (in memory, a file or somewhere persistent), close the baselines and use the stored information instead for whatever purpose you need it for. Can you give some details on what your script is supposed to do? Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: How to Display Object Modifications of Suspect Links of Baselined Module Mathias Mamsch - Thu Jun 10 14:57:49 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS First, thanks for your time - I appreciate it! This module is very much the basis for most of our development, and it's both a very old and very massive file. I'd have split it up earlier, but it simply isn't feasible with the number of other tasks we have going unfortunately. Performance: That said, DOORS 9.2 freshly opened runs at about 91MB or so. Opening that module in read only bumps the DOORS process up to about 165MB and it remains steady. Script intent: The intention here is to trace an object back to it's creation through baselines, and report on aspects of modifications (user making the modification, date, type, etc) through the life of said object. Baselines certainly don't need to remain open, as I can store that information away in a buffer for printing later, or some other technique that is memory friendly. Once the data is obtained from each baseline, that baseline is no longer needed, and the script would trace back to the next earliest module until we reach either the first baseline, or the object's creation. The trouble I've run into, in your code and my own attempts, has consistently been that each time I close the baseline, DXL complains about opening the next baseline stored away in the skip list. I believe if I can release the baseline from memory, much as you suggest, this problem would disappear - but that is in fact my problem. If you have any ideas, I would be most appreciative! Mike |